
<%@ page import="org.springframework.security.core.context.SecurityContextHolder" %>
<%@ page import="org.springframework.security.core.Authentication" %>
<%@ page import="org.springframework.security.core.AuthenticationException" %>
<%@ page import="org.springframework.security.authentication.AnonymousAuthenticationToken" %>
<fmt:setBundle basename="bundles.application-resources"/>
<h1><fmt:message key="application.title"/></h1>

<style>
<!--
#globalnav {
	position:relative;
	float:left;
	width:100%;
	padding:0 0 1.75em 1em;
	margin:0;
	list-style:none;
	line-height:1em;
}

#globalnav LI {
	float:left;
	margin:0;
	padding:0;
}

#globalnav A {
	display:block;
	color:#444;
	text-decoration:none;
	font-weight:bold;
	background:#ddd;
	margin:0;
	padding:0.25em 1em;
	border-left:1px solid #fff;
	border-top:1px solid #fff;
	border-right:1px solid #aaa;
}

#globalnav A:hover,
#globalnav A:active,
#globalnav A.here:link,
#globalnav A.here:visited {
	background:#bbb;
}

#globalnav A.here:link,
#globalnav A.here:visited {
	position:relative;
	z-index:102;
}

/*subnav*/

#globalnav UL {
	position:absolute;
	left:0;
	top:1.5em;
	float:left;
	background:#bbb;
	width:100%;
	margin:0;
	padding:0.25em 0.25em 0.25em 1em;
	list-style:none;
	border-top:1px solid #fff;
}

#globalnav UL LI {
	float:left;
	display:block;
	margin-top:1px;
}

#globalnav UL A {
	background:#bbb;
	color:#fff;
	display:inline;
	margin:0;
	padding:0 1em;
	border:0
}

#globalnav UL A:hover,
#globalnav UL A:active,
#globalnav UL A.here:link,
#globalnav UL A.here:visited {
	color:#444;
}
-->
</style>

<div id="tabs">
	<ul id="globalnav">
		<li><a href="${pageContext.request.contextPath}/secure/welcome.jsp">Index/Login</a></li>
		<%
	Authentication auth = SecurityContextHolder.getContext().getAuthentication();
	if (auth != null && (!AnonymousAuthenticationToken.class.isAssignableFrom(auth.getClass()))) {
%>	
		<li><a href="${pageContext.request.contextPath}/appuser">Usuarios</a></li>
		<li><a href="${pageContext.request.contextPath}/approle">Roles</a></li>
		<li><a href="${pageContext.request.contextPath}/customer">Clientes</a></li>
		<li><a href="${pageContext.request.contextPath}/product">Producto</a></li>
		<li><a href="<c:url value="/j_spring_security_logout"/>">Logout</a></li>
<% 	}%>		
	</ul>
</div>









